﻿using System;
using System.Web.UI;
using BLL;
namespace SMSWebApp.ModAccount
{
    public partial class AccountShowDetail : System.Web.UI.Page
    {
        public string account = "";
        public string strShowButton = "";

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                if (Request.QueryString["Account"]!=null)
                {
                    account = Request.QueryString["Account"].ToString();
                    ShowButtom(account);
                }
                else
                {
                    Response.Write("没有参数的调用！");
                    return;
                }

            }
        }


        protected void ShowButtom(string account)
        {
            
            //通过帐号所在的部门，获得部门属性，只取最左边一个单词
            //string strPropertie = cb.GetAFieldFromTable("Select Propertie From Admin_Department Where DepartmentID=(select DepartmentID from JimView_Account Where Account='" + account + "')");
            //string[] s = strPropertie.Split(',');
            string propertie= new DepartmentBiz().GetPropertie(account);
            try
            {
                switch (propertie)//不同部门的人，显示最上面的菜单不同
                    {
                        case "manager"://
                            strShowButton = "";
                            break;
                        case "admin"://
                            strShowButton = "";
                            break;
                        case "market"://
                            strShowButton = "";
                            break;
                        case "sale"://  
                            strShowButton = "<td style=\"width: 87px; height: 21px; background-image: url(../Images/page_button_long.gif);\" align=\"center\" valign=\"bottom\">&nbsp;<a href=\"../ModAccount/AccountStaticForOne.aspx?Account=" + account + "\" target=\"ifrmMain\">行为分析</a></td>";
                            strShowButton += "<td style=\"width: 87px; height: 21px; background-image: url(../Images/page_button_long.gif);\" align=\"center\" valign=\"bottom\">&nbsp;<a href=\"../ModSale/QuotationList.aspx?Account=" + account + "\" target=\"ifrmMain\">报价单</a></td>";
                            strShowButton += "<td style=\"width: 87px; height: 21px; background-image: url(../Images/page_button_long.gif);\" align=\"center\" valign=\"bottom\">&nbsp;<a href=\"../ModSale/OrderList.aspx?ParamID=" + account + "&IDType=Personal\" target=\"ifrmMain\">历史订单</a></td>";
                            strShowButton += "<td style=\"width: 87px; height: 21px; background-image: url(../Images/page_button_long.gif);\" align=\"center\" valign=\"bottom\">&nbsp;<a href=\"../ModFinance/ReceivablesList.aspx?Account=" + account + "\" target=\"ifrmMain\">应收款</a></td>";
                            break;
                        case "finance"://财务
                            strShowButton = "";
                            break;
                        case "stock"://采购
                            strShowButton = "";
                            break;
                        case "transport"://物流/仓库
                            strShowButton = "";
                            break;
                        case "service"://客户服务
                            strShowButton = "";
                            break;
                        case "research"://研发
                            strShowButton = "";
                            break;
                        case "produce"://生产
                            strShowButton = "";
                            break;
                        case "human"://人事
                            strShowButton = "";
                            break;
                        case "plan"://策划
                            strShowButton = "";
                            break;
                        case "design"://设计
                            strShowButton = "";
                            break;
                        default:
                            break;
                    }
                                
            }
            catch (Exception ex)
            {
                Response.Write("错误，错误原因：" + ex.Message);
            }
            
        }

        //c
    }
}
